/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.server.modules.sys.service.loan;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.server.common.service.TreeService;
import com.server.common.utils.StringUtils;
import com.server.modules.sys.entity.loan.LoanType;
import com.server.modules.sys.dao.loan.LoanTypeDao;

/**
 * 贷款类型表Service
 * @author 王磊
 * @version 2016-09-13
 */
@Service
@Transactional(readOnly = true)
public class LoanTypeService extends TreeService<LoanTypeDao, LoanType> {

	public LoanType get(String id) {
		return super.get(id);
	}
	
	public List<LoanType> findList(LoanType loanType) {
		if (StringUtils.isNotBlank(loanType.getParentIds())){
			loanType.setParentIds(","+loanType.getParentIds()+",");
		}
		return super.findList(loanType);
	}
	
	@Transactional(readOnly = false)
	public void save(LoanType loanType) {
		super.save(loanType);
	}
	
	@Transactional(readOnly = false)
	public void delete(LoanType loanType) {
		super.delete(loanType);
	}
	
}